package com.gin.kotlin.no_gay_alliance.adapter.user

import android.content.Context
import com.gin.kotlin.no_gay_alliance.base.AbstractBindingRecyclerViewAdapter
import com.gin.kotlin.no_gay_alliance.base.MyHandler
import com.gin.kotlin.no_gay_alliance.databinding.ItemOldNameBinding
import com.gin.kotlin.no_gay_alliance.utils.TimeUtils
import com.gin.nga.response.user.OldName

class OldNameAdapter(context: Context, handler: MyHandler, data: MutableList<OldName> = mutableListOf()) :
    AbstractBindingRecyclerViewAdapter<ItemOldNameBinding, OldName>(context, handler, false, data) {
    override fun onBindViewHolder(holder: ViewHolder<ItemOldNameBinding>, position: Int, b: ItemOldNameBinding, dataModel: OldName) {
        b.tvUsername.text = dataModel.username
        b.tvTimestamp.text = TimeUtils.FULL_DATE_TIME_FORMATTER.format(dataModel.before).let { "截至 $it" }
    }
}